package net.minecraft.src;

import java.io.*;
import java.util.*;
import net.minecraft.client.Minecraft;

public class mod_NetherrackFurnace extends BaseMod{
    public mod_NetherrackFurnace(){
        Properties properties = new Properties();
        try
        {
            File file = new File((new StringBuilder()).append(Minecraft.getMinecraftDir()).append("/config/mod_NetherrackFurnace.cfg").toString());
            boolean flag = file.createNewFile();
            if(flag)
            {
                FileOutputStream fileoutputstream = new FileOutputStream(file);
                properties.setProperty("furnaceIdleID", Integer.toString(200));
                properties.setProperty("furnaceActiveID", Integer.toString(201));
                properties.store(fileoutputstream, "Change the ID's to fix ID incompatibilities.");
                fileoutputstream.close();
            }
            properties.load(new FileInputStream((new StringBuilder()).append(Minecraft.getMinecraftDir()).append("/config/mod_NetherrackFurnace.cfg").toString()));
            furnaceIdleID = Integer.parseInt(properties.getProperty("furnaceIdleID"));
            furnaceActiveID = Integer.parseInt(properties.getProperty("furnaceActiveID"));
            
            //debug log
            /*File log = new File((new StringBuilder()).append(Minecraft.getMinecraftDir()).append("/mod_NetherrackFurnace.log").toString());

            FileWriter fw = new FileWriter(log,true);
            PrintWriter pw=new PrintWriter(fw);
            pw.println("-----ModStarted");
            pw.close();*/
        }
        catch(IOException ioexception)
        {
            ioexception.printStackTrace();
        }
        furnaceIdle = (new BlockNetherrackFurnace(furnaceIdleID, false)).setHardness(3F).setResistance(2000F).setBlockName("nFurnaceIdle");
        furnaceActive = (new BlockNetherrackFurnace(furnaceActiveID, true)).setHardness(3F).setResistance(2000F).setLightValue(1.0F).setBlockName("nFurnaceActive");

        ModLoader.RegisterBlock(furnaceIdle);
        ModLoader.RegisterBlock(furnaceActive);
        ModLoader.RegisterTileEntity(net.minecraft.src.TileEntityNetherrackFurnace.class, "netherrackfurnaceIdle");
        ModLoader.AddName(furnaceIdle, "Netherrack Furnace");
        ModLoader.AddName(furnaceActive, "Netherack Furnace"); 
        ModLoader.AddRecipe(new ItemStack(furnaceIdle,1), new Object []{"NNN","N N","NNN",
            Character.valueOf('N'), Block.netherrack
        });
    }
    public String Version(){
        return "0.1";
    }
    
    public static Block furnaceIdle;
    public static Block furnaceActive;
    public static int texfurnacefrontidle = ModLoader.addOverride("/terrain.png", "/netherrackFurnaceTextures/furnacefrontidle.png");
    public static int texfurnacefrontactive = ModLoader.addOverride("/terrain.png", "/netherrackFurnaceTextures/furnacefrontactive.png");
    public static int texfurnaceside = ModLoader.addOverride("/terrain.png", "/netherrackFurnaceTextures/furnaceside.png");
    public static int texfurnacetop = ModLoader.addOverride("/terrain.png", "/netherrackFurnaceTextures/furnacetop.png");
    public static int furnaceIdleID;
    public static int furnaceActiveID;
}